	<include file='Common:header' />

		<!-- /section:basics/navbar.layout -->
		<div class="main-container" id="main-container">

			<!-- #section:basics/sidebar -->

	<include file='Common:left' />


			<!-- /section:basics/sidebar -->
			<div class="main-content">
				<div class="main-content-inner">
					<div class="page-content">

                        
                        
                        <!--主题-->
						<div class="page-header">
							<h1>
								您当前操作
								<small>
									<i class="ace-icon fa fa-angle-double-right"></i>
									加减金币
								</small>
							</h1>
						</div>

<script>
$(function(){
	$('#admin_list_add').ajaxForm({
		beforeSubmit: checkForm, // 此方法主要是提交前执行的方法，根据需要设置
		success: complete, // 这是提交后的方法
		dataType: 'json'
	});
	
	function checkForm(){

		if( '' == $.trim($('#member_tel').val())){
			layer.alert('目标账号不能为空', {icon: 6}, function(index){
 			layer.close(index);
			$('#member_tel').focus();
			});
			return false;
		}

		var telRet = /(13|14|15|18)[0-9]{9}/;

        if(!telRet.test($('#member_tel').val())){
			layer.alert('目标账号格式不正确，请重新输入', {icon: 6}, function(index){
				layer.close(index);
				$('#member_tel').focus();
			});
            return false
        }

        if( '' == $.trim($('#gold_type option:selected').val())){
            layer.alert('请选择操作类型', {icon: 6}, function(index){
                layer.close(index);
                $('#gold_type').focus();
            });
            return false;
        }

        if( '' == $.trim($('#gold_coins').val())){
            layer.alert('金币数量不能为空', {icon: 6}, function(index){
                layer.close(index);
                $('#member_nickname').focus();
            });
            return false;
        }

        var goldCoins =  /[1-9]\d*/;

        if(!goldCoins.test($('#gold_coins').val())){
            layer.alert('数量填写错误', {icon: 6}, function(index){
                layer.close(index);
                $('#gold_coins').focus();
            });
            return false
        }
		
		
 }
	function complete(data){
		if(data.status==1){
			layer.alert(data.info, {icon: 6}, function(index){
 			layer.close(index);
			window.location.href=data.url;
			});
		}else{
			layer.alert(data.info, {icon: 6}, function(index){
 			layer.close(index);
			$('#member_tel').focus();
			});
			return false;	
		}
	}
 
});
</script>


						<div class="row">
							<div class="col-xs-12">
								<form class="form-horizontal" name="admin_list_add" id="admin_list_add" method="post" action="__URL__/gold_add_subtract">

									<div class="form-group">
										<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 目标账号：  </label>
										<div class="col-sm-10">
											<input type="text" name="member_tel" id="member_tel" placeholder="输入目标账号" class="col-xs-10 col-sm-4" />
											<span class="lbl">&nbsp;&nbsp;<span class="red">*</span></span>
										</div>
									</div>
									<div class="space-4"></div>

									<div class="form-group">
										<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 执行操作：  </label>
										<div class="col-sm-10">
											<select name="gold_type" id="gold_type" class="col-sm-4" >
												<option value="">请选择操作类型</option>

												<option value="add">增加金币</option>
												<option value="subtract">减少金币</option>

											</select>
										</div>
									</div>
									<div class="space-4"></div>

									<div class="form-group">
										<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 填写数量：  </label>
										<div class="col-sm-10">
											<input type="text" name="gold_coins" id="gold_coins" placeholder="输入数量" class="col-xs-10 col-sm-4" />
											<span class="lbl">&nbsp;&nbsp;<span class="red">*</span></span>
										</div>
									</div>
                                    <div class="space-4"></div>

									<div class="clearfix form-actions">
										<div class="col-md-offset-3 col-md-9">
											<button class="btn btn-info" type="submit">
												<i class="ace-icon fa fa-check bigger-110"></i>
												保存
											</button>

											&nbsp; &nbsp; &nbsp;
											<button class="btn" type="reset">
												<i class="ace-icon fa fa-undo bigger-110"></i>
												重置
											</button>
										</div>
									</div>
								</form>
                        	</div>
                        </div>
									<div class="hr hr-24"></div>

<include file='Common:header_nav' />

					</div><!-- /.page-content -->
				</div>
			</div><!-- /.main-content -->

	<include file='Common:footer' />

		</div><!-- /.main-container -->

    		<!--下拉样式以及JS-->
		<link rel="stylesheet" href="__PUBLIC__/assets/css/chosen.css" />
		<script src="__PUBLIC__/assets/js/chosen.jquery.js"></script>
		<script type="text/javascript">
			jQuery(function($) {
				if(!ace.vars['touch']) {
					$('.chosen-select').chosen({allow_single_deselect:true}); 
					$(window)
					.off('resize.chosen')
					.on('resize.chosen', function() {
						$('.chosen-select').each(function() {
							 var $this = $(this);
							 $this.next().css({'width': $this.parent().width()});
						})
					}).trigger('resize.chosen');
			
				}
			});
		</script>
	</body>
</html>
